package com.linoer.cloud.alo.accountservice.service;

import com.linoer.cloud.alo.common.domain.ObjectResponse;
import com.linoer.cloud.alo.common.domain.dto.AccountDTO;
import com.linoer.cloud.alo.common.service.dubbo.AccountDubboService;
import io.seata.core.context.RootContext;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.Service;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * @Classname AccountDubboServiceImp
 * @Description 远程账户服务接口
 * @Date 2021/6/22 9:26 下午
 * @Created by muhenglv
 */
@Slf4j
@Service(version = "1.0.0", timeout = 3000)
public class AccountDubboServiceImp implements AccountDubboService {

    @Autowired
    private AccountService accountService;

    @Override
    public ObjectResponse decreaseAccount(AccountDTO account) {
        log.info("======> 全局事务ID:{}", RootContext.getXID());
        return accountService.decreaseAccount(account);
    }
}
